import showdown from "showdown"


// 创建自定义扩展
const lineSpacingExtension = {
  type: 'lang',
  regex: /(.+)/g,
  // replace: '<p style="margin-bottom: 10px;">$1</p>',
  replace: '$1',
};

// 添加扩展到 Showdown 中
showdown.extension('lineSpacing', () => [lineSpacingExtension]);


const converter = new showdown.Converter({ extensions: ['lineSpacing'] });
export const parseMdToHtml = (val: string) => {
  return converter.makeHtml(val)
}
